<template>
	<view class="radioBgc" >
		<block v-if="list.length > 0">
		<view class="radioBox me-fx-row-start-c" v-for="(item, index) in list">
			<image :src="item.payer.avatar" mode=""></image>
			<view class="radioRightBox">
				<view class="radioRightHead me-text-beyond-multi">
					{{item.content}}
				</view>
				<view class="me-fx-row-sb-c marginTop">
					<view class="time">
						{{item.created_at}}
					</view>
				</view>
			</view>
		</view>
		</block>
		<view class="nohave" v-if="nohave">
			<image src="../../static/img/newimg/xx.png" mode=""></image>
			暂时没有更多数据啦~
		</view>
	</view>
</template>

<script>
	import {
		demo
	} from '@/utils/utils'
	export default {
		data() {
			return {
				page: 1,
				list: [],
				nohave: false,
				last_page:1
			}
		},
		created() {
			this.getIndex(this.page)
		},
		methods: {
			getIndex(page) {
				this.$u.get('/message/album/file/pay/list/' + page).then(res => {
						if (res) {
							this.last_page = res.data.list.last_page
							let that = this
							if (res.data.list.current_page == 1) {
								this.list = res.data.list.data
							} else {
								this.list = this.list.concat(res.data.list.data)
							}
							if (res.data.list.data.length <= 0) {
								this.nohave = true
							} else {
								this.nohave = false
							}
							
						}
					})
					.catch((res) => {
						console.log(res.message)
					})
			},

			onReachBottom() { //uniapp 监听下拉加载生命周期
				if (this.page >= this.last_page) {
					uni.showToast({
						title: '没有更多数据了',
						duration: 1000,
						icon: 'none'
					})
					return
				}
				this.page++
				this.getIndex(this.page)
			},

		}
	}
</script>

<style>
	.radioBgc {
		border-top: 1rpx solid rgba(245, 245, 245, 1);
	}

	.radioBox {
		padding: 26rpx;
		box-sizing: border-box;
		border-bottom: 1rpx solid rgba(245, 245, 245, 1);
	}

	.radioBox image {
		width: 104rpx;
		height: 104rpx;
		border-radius: 8rpx;
	}

	.radioRightBox {
		margin-left: 24rpx;
		width: 80%;
	}

	.goLook {
		font-size: 26rpx;
		color: rgba(102, 102, 102, 1);
	}

	.marginTop {
		margin-top: 14rpx;
	}

	.radioRightBox .time {
		font-size: 26rpx;
		color: rgba(102, 102, 102, 1);
	}

	.radioRightBox .rightjt {
		width: 10px;
		height: 20px;
	}

	.radioRightHead {
		font-size: 32rpx;
		color: rgba(68, 68, 68, 1);
	}

	.nohave {
		padding: 20rpx;
		text-align: center;
	}

	.nohave image {
		width: 100%;
		height: 537rpx;
		display: block;
	}
</style>
